<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\daikuan\controller;

use cmf\controller\AdminBaseController;
use app\daikuan\model\AboutModel;

/**
 * Description of DKSettingController
 *
 * @author PVer
 */
class DKSettingController extends AdminBaseController {

    //put your code here
    public function about() {
        $aboutModel = new AboutModel();
        $info = $aboutModel->find();
        $this->assign('info', $info);
        return $this->fetch();
    }

    public function editPost() {
        if ($this->request->isPost()) {
            $data = $this->request->post();
            $content = $data['content'];
            $arr = array();
            $arr['content'] = $data['content'];
            $aboutModel = new AboutModel();
            $result = $aboutModel->save($arr, 'id=1');
            if ($result !== false) {
                $this->success("操作成功");
            } else {
                $this->error("操作失败");
            }
        } else {
            $this->error("数据错误");
            return $this->fetch();
        }
    }

}
